﻿@model AddressModel
@using Nop.Web.Models.Checkout;
@using Logistics.Web.Models.Common;

<div class="address-@Model.Id address-item"
     data-id="@Model.Id" data-firstname="@Model.FirstName" data-lastname="@Model.LastName" data-address1="@Model.Address1" data-address2="@Model.Address2" data-city="@Model.City" data-stateprovince="@Model.StateProvinceId"
     data-company="@Model.Company" data-zippostalcode="@Model.ZipPostalCode" data-email="@Model.Email" data-cellphone="@Model.CellPhoneNumber" data-phone="@Model.PhoneNumber" data-country="@Model.CountryId">
    <div class=" address-render-wrapper">
        <div class="address-render-content">
            @if (Model.StreetAddressEnabled && !String.IsNullOrEmpty(Model.Company))
            {
                <div><strong>@Model.Company</strong></div>
            }
            else
            {
                <div><strong>@Model.FirstName @Model.LastName</strong></div>
            }
            @if (Model.StreetAddressEnabled && !String.IsNullOrEmpty(Model.Address1))
            {
                <div>
                    @if (!String.IsNullOrEmpty(Model.Address2))
                    {
                        @Model.Address2 @Model.Address1
                    }
                    else
                    {
                        @Model.Address1
                    }
                </div>
            }
            @if (Model.CityEnabled && !String.IsNullOrEmpty(Model.City))
            {
                if (!String.IsNullOrEmpty(Model.StateProvinceName))
                {
                    <div>@Model.City, @Model.StateProvinceName</div>
                }
                else
                {
                    <div>@Model.City</div>
                }
                <div>@Model.CountryName @Model.ZipPostalCode</div>
            }
            @if (!String.IsNullOrEmpty(Model.Email))
            {
                <div>@Model.Email</div>
            }
            @if (!String.IsNullOrEmpty(Model.PhoneNumber))
            {
                <div>@Model.PhoneNumber</div>
            }
            else if (!String.IsNullOrEmpty(Model.CellPhoneNumber))
            {
                <div>Phone: @Model.CellPhoneNumber</div>
            }
        </div>

        <div class="address-render-control">
           <input type="button" class="address-select button-grey" data-id="@Model.Id" value="Select This Address" />
           <!--<input type="button" class="address-edit" data-id="@Model.Id" value="&#xf040; Edit" />
            <input type="button" class="address-delete" data-id="@Model.Id" value="&#xf00D; Delete" />-->
        </div>

    </div>

</div>